package com.hx.voice.recognition.gateway.feign;

import com.hx.voice.recognition.api.vo.authority.PermissionInfo;
import com.hx.voice.recognition.gateway.fallback.UserServiceFallback;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @descripe：用户权限feign接口
 * @company：南京华讯方舟通讯设备有限公司
 * @author：zhoujinbing
 * @time：2019/6/12 9:12
 * @version：V1.0
 */
@FeignClient(value = "voice-admin",fallback = UserServiceFallback.class,configuration = FeignAutoConfiguration.class)
public interface IUserService {

    /**
     * @description 根据登录账号账号获取权限
     * @method  getPermissionByUserName
     * @param  [username]
     * @return java.util.List<com.hx.zjb.security.api.vo.authority.PermissionInfo>
     * @date: 2019/6/13 15:03
     * @author:zhoujinbing
     */
    @RequestMapping(value = "/api/user/un/{username}/permissions",method = RequestMethod.GET)
    public List<PermissionInfo> getPermissionByUserName(@PathVariable("username") String username);

    @RequestMapping(value = "/api/permissions",method = RequestMethod.GET)
    List<PermissionInfo> getAllPermissionInfo();
}